refactor(express): split login endpoint into V1 and V2#8586
refactor(express): split login endpoint into V1 and V2#8586rishikeshdadam136 wants to merge 1 commit intomasterfrom
Conversation
cddd275 to
102721b
Compare
|
Tested in local for both v1 and v2 |
102721b to
e6c756b
Compare
e6c756b to
9e915f2
Compare
6105329 to
49b1ad3
Compare
49b1ad3 to
fc27898
Compare
fc27898 to
5837659
Compare
mrdanish26
left a comment
There was a problem hiding this comment.
CI failure, flushing the queue
5837659 to
9ea2d74
Compare
9ea2d74 to
82e1f22
Compare
| body: LoginRequest, | ||
| }), | ||
| response: { | ||
| 200: t.type({ |
There was a problem hiding this comment.
Nit: We can create common type for this
lokesh-bitgo
left a comment
There was a problem hiding this comment.
Overall changes looks good
c4a7bdb
82e1f22 to
c4a7bdb
Compare
|
Resolved merge conflicts and force pushed again. |
melizafranco
left a comment
There was a problem hiding this comment.
Duplicate or ambiguous entries in an OpenAPI spec create confusion in generated docs, client SDKs, and tools like Postman. Each operation should have a unique operationId, a distinct path, and a summary that makes clear what it is and how it differs from the similar one.
| * Login | ||
| * | ||
| * Authenticate a user and retrieve their session details. | ||
| * | ||
| * @operationId express.login | ||
| * @tag Express | ||
| * @public | ||
| */ | ||
| export const PostV2Login = httpRoute({ | ||
| path: '/api/v2/user/login', |
There was a problem hiding this comment.
| * Login | |
| * | |
| * Authenticate a user and retrieve their session details. | |
| * | |
| * @operationId express.login | |
| * @tag Express | |
| * @public | |
| */ | |
| export const PostV2Login = httpRoute({ | |
| path: '/api/v2/user/login', | |
| * Login (Express) | |
| * | |
| * Authenticate a user and retrieve their session details using BitGo Express. | |
| * | |
| * @operationId express.login | |
| * @tag Express | |
| * @public | |
| */ | |
| export const PostV2Login = httpRoute({ | |
| path: '/api/v2/user/login/express', |
Make this endpoint path and summary unique from the REST login endpoint to avoid client confusion.
c4a7bdb to
9096606
Compare
@melizafranco, I understand your point. However, the scope of this change is different. This is an existing login endpoint that previously combined both V1 and V2, which caused the API docs to fail to compile. You can find the details here: https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B. Based on the feedback, we are splitting the endpoint into separate V1 and V2 endpoints with unique operationIds and paths, without changing the behavior. We will mark the V1 endpoint as private and the V2 endpoint as public, and only the V2 endpoint will be used by clients. Regarding your feedback, the operationId is already unique and the paths are already distinct (V1 and V2). Since the behavior of both endpoints remains the same, the summary is also the same. As we are only splitting the endpoint without changing any existing behavior, I think the changes look fine. Please let me know if you have any concern here. |
Ticket: WCI-186
Context - https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B
The API behavior is not changing. We are splitting the combined v[12] route into two separate V1 and V2 routes, so both will continue to work and clients will not be affected.